#! /usr/bin/python3 python3
# -*- coding: utf-8 -*-

# *************************************************************
#  Projectname @  pysm
#     Filename @  index.py
#       Author @  Steve.ma
#  Create date @  2018/8/31
#  Description @  
# *************************************************************

from .. import api_blueprint
from Models.ApiController import *
import hprose

class IndexController(ApiControllerModel) :
    Controller = 'Index'
    def index(self):
        # return self.returnMsg(False, {
        #     "code": 10010,
        #     "message": "错误啦"
        # })

        client = hprose.HttpClient('http://127.0.0.1:8181/')
        res = {}
        res['loginIndex'] = client.loginIndex(self.getHproseParams({'id': '9', 'name': 'nick'}))
        # print(client.loginId(self.getHproseParams({'id': '9', 'name2': 'nick'})))
        res['loginId'] = client.loginId(self.getHproseParams({'id': '9', 'name2': 'nick'}))

        print(res)
        return 'res in print'
        #
        # return self.returnMsg(False, {
        #     "code"      : 10010,
        #     "message"   : "错误啦"
        # })

Controller = IndexController();

@api_blueprint.route('/')
def IndexIndex():
    return Controller.index()
